import 'dart:io';

import 'package:image_picker/image_picker.dart';
import 'package:permission_handler/permission_handler.dart';

class ImageAlbumTool{
  static Future getLocalImage(
      Function callback, {
        bool isBackModel = false,
      }) async {
    // if (await Permission.photos.request().isGranted ||
    //     await Permission.photosAddOnly.request().isLimited) {
      final image = await ImagePicker().pickImage(source: ImageSource.gallery);
      if (image != null) {
        callback(image);
      } else {
          print('相册点击了取消');
      }
    // } else {
    //   JCDialog.show(Get.context!, {
    //     'title': "温馨提示",
    //     'content': "相册权限未开启,请去系统设置页面打开权限",
    //     'showCancel': false,
    //     'confirmText': '好的',
    //     'onConfirm': () {},
    //   });
   //  }
  }

}